//
//  WSJSportView.m
//  RunningMan
//
//  Created by dllo on 16/5/17.
//  Copyright © 2016年 WSJ. All rights reserved.
//

#import "WSJSportView.h"
#import "WSMyTool.h"
@interface WSJSportView ()

@end

@implementation WSJSportView

- (instancetype)initWithFrame:(CGRect)frame {
    self = [super initWithFrame:frame];
    if (self) {
        self.backgroundColor = [UIColor colorWithRed:100 / 255.0 green:200 / 255.0 blue:170 / 255.0 alpha:1.0];
        [self createSubView];
    }
    return self;
}
- (void)createSubView {
    self.labelMileage = [[UILabel alloc] initWithFrame:CGRectMake(0, 60, WIDTH, 100)];
    self.labelMileage.textAlignment = NSTextAlignmentCenter;
    self.labelMileage.text = @"0.00";
    self.labelMileage.textColor = [UIColor whiteColor];
    self.labelMileage.font = [UIFont boldSystemFontOfSize:100 * FITWIDTH];
    [self addSubview:self.labelMileage];
    
    UILabel *labelMileageText = [[UILabel alloc] initWithFrame:CGRectMake(0, 200 , WIDTH, 30)];
    labelMileageText.text = @"跑步总里程";
    labelMileageText.font = [UIFont systemFontOfSize:27];
    labelMileageText.textAlignment = NSTextAlignmentCenter;
    labelMileageText.textColor = [UIColor whiteColor];
    [self addSubview:labelMileageText];
    
    self.labelTime = [[UILabel alloc] initWithFrame:CGRectMake(0, 300, WIDTH / 3, 40)];
    self.labelTime.text = @"0.0";
//    self.labelTime.backgroundColor = COLOR;
    self.labelTime.textAlignment = NSTextAlignmentCenter;
    self.labelTime.textColor = [UIColor whiteColor];
    self.labelTime.font = [UIFont systemFontOfSize:44];
    [self addSubview:self.labelTime];
    
    UILabel *labelTime = [[UILabel alloc] initWithFrame:CGRectMake(0, 350, WIDTH / 3, 30)];
    labelTime.text = @"累计用时";
    labelTime.textAlignment = NSTextAlignmentCenter;
//    labelTime.backgroundColor = COLOR;
    labelTime.font = [UIFont systemFontOfSize:20];
    labelTime.textColor = [UIColor whiteColor];
    [self addSubview:labelTime];
    
    self.labelStep = [[UILabel alloc] initWithFrame:CGRectMake(WIDTH / 3, 300, WIDTH / 3, 40)];
    self.labelStep.textAlignment = NSTextAlignmentCenter;
    self.labelStep.text = @"000";
    self.labelStep.textColor = [UIColor whiteColor];
    self.labelStep.font = [UIFont systemFontOfSize:44];
    [self addSubview:self.labelStep];
    
    UILabel *labelStep = [[UILabel alloc] initWithFrame:CGRectMake(WIDTH / 3, 350, WIDTH / 3, 30)];
    labelStep.textColor = [UIColor whiteColor];
    labelStep.text = @"累计步数";
    labelStep.textAlignment = NSTextAlignmentCenter;
    labelStep.font = [UIFont systemFontOfSize:20];
    [self addSubview:labelStep];
    
    self.labelNumber = [[UILabel alloc] initWithFrame:CGRectMake(WIDTH / 3 * 2, 300, WIDTH / 3, 40)];
    self.labelNumber.textAlignment = NSTextAlignmentCenter;
    self.labelNumber.text = @"000";
    self.labelNumber.textColor = [UIColor whiteColor];
    self.labelNumber.font = [UIFont systemFontOfSize:44];
    [self addSubview:self.labelNumber];
    
    UILabel *labelNumberText = [[UILabel alloc] initWithFrame:CGRectMake(WIDTH / 3 * 2, 350, WIDTH / 3, 30)];
    labelNumberText.textColor = [UIColor whiteColor];
    labelNumberText.textAlignment = NSTextAlignmentCenter;
    labelNumberText.text = @"运动次数";
    labelNumberText.font = [UIFont systemFontOfSize:20];
    [self addSubview:labelNumberText];
    
    self.StartRunningBtn = [UIButton buttonWithType:UIButtonTypeCustom];
    self.StartRunningBtn.frame = CGRectMake(0, 450, WIDTH, 59);
    [self.StartRunningBtn setTitle:@"开始跑步" forState:UIControlStateNormal];
    self.StartRunningBtn.titleLabel.font = [UIFont systemFontOfSize:40];
    
    [self addSubview:self.StartRunningBtn];
    
//    self.labelNumber.backgroundColor = COLOR;
//    labelStep.backgroundColor = COLOR;
//    self.labelStep.backgroundColor = COLOR;
}

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
